import requests
import json

# 阿里云节假日API的URL
url = "https://lab.isaidata.com:443/holiday/api/holiday/getHolidayInfo"

# 请求参数，这里以2023年为例
params = {
    "countryCode": "CN",
    "year": "2023"
}

# 发起GET请求
response = requests.get(url, params=params)

# 判断请求是否成功
if response.status_code == 200:
    # 解析JSON数据
    data = json.loads(response.text)
    # 打印节假日信息
    for holiday in data:
        print(f"节假日名称: {holiday['holidayName']}")
        print(f"开始日期: {holiday['startDate']}")
        print(f"结束日期: {holiday['endDate']}")
        print()
else:
    print("请求失败")
